package com.rightsidetech.mall.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * mall_commodity_specs
 * @author
 */
public class MallCommoditySpecs implements Serializable {
    /**
     * 主键
     */
    private Long id;

    /**
     * 商品通用id
     */
    private Long commodityId;

    /**
     * 多个规格id
     */
    private String specsIds;

    /**
     * 价格
     */
    private BigDecimal price;

    /**
     * 以旧换新价格
     */
    private BigDecimal inNewPrice;

    /**
     * 规格条码
     */
    private String barCode;

    /**
     * 图片
     */
    private String picture;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 商品规格
     */
    private String commoditySpecs;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(Long commodityId) {
        this.commodityId = commodityId;
    }

    public String getSpecsIds() {
        return specsIds;
    }

    public void setSpecsIds(String specsIds) {
        this.specsIds = specsIds;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getInNewPrice() {
        return inNewPrice;
    }

    public void setInNewPrice(BigDecimal inNewPrice) {
        this.inNewPrice = inNewPrice;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public String getCommoditySpecs() {
        return commoditySpecs;
    }

    public void setCommoditySpecs(String commoditySpecs) {
        this.commoditySpecs = commoditySpecs;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MallCommoditySpecs other = (MallCommoditySpecs) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCommodityId() == null ? other.getCommodityId() == null : this.getCommodityId().equals(other.getCommodityId()))
                && (this.getSpecsIds() == null ? other.getSpecsIds() == null : this.getSpecsIds().equals(other.getSpecsIds()))
                && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
                && (this.getInNewPrice() == null ? other.getInNewPrice() == null : this.getInNewPrice().equals(other.getInNewPrice()))
                && (this.getBarCode() == null ? other.getBarCode() == null : this.getBarCode().equals(other.getBarCode()))
                && (this.getPicture() == null ? other.getPicture() == null : this.getPicture().equals(other.getPicture()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
                && (this.getCommoditySpecs() == null ? other.getCommoditySpecs() == null : this.getCommoditySpecs().equals(other.getCommoditySpecs()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCommodityId() == null) ? 0 : getCommodityId().hashCode());
        result = prime * result + ((getSpecsIds() == null) ? 0 : getSpecsIds().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getInNewPrice() == null) ? 0 : getInNewPrice().hashCode());
        result = prime * result + ((getBarCode() == null) ? 0 : getBarCode().hashCode());
        result = prime * result + ((getPicture() == null) ? 0 : getPicture().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getCommoditySpecs() == null) ? 0 : getCommoditySpecs().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", commodityId=").append(commodityId);
        sb.append(", specsIds=").append(specsIds);
        sb.append(", price=").append(price);
        sb.append(", inNewPrice=").append(inNewPrice);
        sb.append(", barCode=").append(barCode);
        sb.append(", picture=").append(picture);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", commoditySpecs=").append(commoditySpecs);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}